package com.zhang.step1;
import org.junit.Test;
import java.io.IOException;
import java.util.logging.Level;
import java.util.logging.LogManager;
import java.util.logging.Logger;
public class Test1 {

    //1.加载日志
    static LogManager logManager = LogManager.getLogManager();
    static {
        try {
            logManager.readConfiguration(Test1.class.getClassLoader().getResourceAsStream("logging.properties"));
        } catch (IOException e) {
            e.printStackTrace();
        }
    }

    @Test
    public void test1() {
        Logger logger = Logger.getLogger("com.zhang.test2.Properties");

        logger.log(Level.FINEST, "finest level");
        logger.log(Level.FINER, "finer level");
        logger.log(Level.FINE, "fine level");
        logger.log(Level.CONFIG, "config level");
        logger.log(Level.INFO, "info level");
        logger.log(Level.WARNING, "warning level");
        logger.log(Level.SEVERE, "severe level");
    }

}




